<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Insert title here</title>
<script>
function iFrameOn(){
    rte.document.designMode = 'On';
}

function createLink(selected){
	var szURL = prompt("Enter a URL:", "http://");
    rte.document.execCommand('CreateLink', false, szURL);
}

function deleteLink(){
    rte.document.execCommand('unlink', false, null);
}

function superScript(){
	rte.document.execCommand('superscript', false, null); // 위 첨자
}

function subScript(){
	rte.document.execCommand('subscript', false, null); // 아래 첨자
}

function undo(){
	rte.document.execCommand('undo', false, null); 
}

function redo(){
	rte.document.execCommand('redo', false, null); 
}

function orderedList(){
	rte.document.execCommand('insertOrderedList', false, null);
}

function unorderedList(){
	rte.document.execCommand('insertUnorderedList', false, null);
}

function justifyFull(){
    rte.document.execCommand('justifyFull', null); // 안됨...
}

function increaseFontSize(){
	rte.document.execCommand('increaseFontSize', false, null); // 크롬, IE에서는 지원안함
}

function decreaseFontSize(){
	rte.document.execCommand('decreaseFontSize', false, null); // 크롬, IE에서는 지원안함
}

</script>
</head>
<body onload="iFrameOn();">
	<input type="button" onclick="deleteLink()" value="delLink">
	<input type="button" onclick="createLink()" value="Link">
	<input type="button" onclick="superScript()" value="superscript">
	<input type="button" onclick="subScript()" value="subscript">
	<input type="button" onclick="undo()" value="undo">
	<input type="button" onclick="redo()" value="redo">
	<input type="button" onclick="orderedList()" value="문단번호 1.2.3.">
	<input type="button" onclick="unorderedList()" value="문단번호 땡땡">
	<input type="button" onclick="justifyFull()" value="양쪽정렬">
	<input type="button" onclick="increaseFontSize()" value="글자 크게">
	<input type="button" onclick="decreaseFontSize()" value="글자 작게">
	<br />
	<iframe name="rte" id="rte" style="border:#000000 1px solid;"></iframe>
	<br />
	<input type="button" onclick="readFrame()" value="Show HTML Output">


</body>
</html>